@extends('admin.layout.index')
@section('js')
<script src="/web/js/libs/jquery-1.8.3.min.js"></script>
<script>
$(function (){
    $('[name=tid]').blur(function (){
        val = $(this).val();
        $.get('/admin/goods/verify','tid='+val, function (msg){
            if(msg == 1){
                $('#text').empty().append('<font style="color:red">请选择详细的所属分类</font>')
            }else{
                $('#text').empty().append('<font style="color:green">已选择精准的所属分类</font>')
            }
        },'html')
    })
})
</script>
@endsection
@section('content')
@if (count($errors) > 0)
    <div class="mws-form-message error">
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif
<div class="mws-panel grid_8">
	<div class="mws-panel-header">
    	<span>商品添加</span>
    </div>
    <div class="mws-panel-body no-padding">
    	<form action="/admin/goods/insert" class="mws-form" method='post' enctype="multipart/form-data">
    		{{csrf_field()}}
    		<div class="mws-form-inline">
                <div class="mws-form-row">
                    <label class="mws-form-label">货号</label>
                    <div class="mws-form-item">
                        <input type="text" class="small" name="articlenum" style="width:200px"><span>   【货号为6位】</span>
                    </div>
                </div>
    			<div class="mws-form-row">
    				<label class="mws-form-label">商品描述</label>
    				<div class="mws-form-item">
    					<input type="text" class="small" name="goodsdes" style="width:200px">
                        <span>【必填项】</span>
    				</div>
    			</div>
    			<div class="mws-form-row">
    				<label class="mws-form-label">商品所属类</label>
    				<div class="mws-form-item">
    					<select class="large" name="tid" style="width:200px">
    					<option>--请选择--</option>
    					@foreach($data as $k => $v)
    						<option value="{{$v['id']}}">{{$v['cname']}}</option>
    					@endforeach
    					</select>
                        <span>【必填项】</span>
                        <span id='text'></span>
    				</div>
    			</div>
                <div class="mws-form-row">
<<<<<<< HEAD
                    <label class="mws-form-label">商品适合性别</label>
                    <div class="mws-form-item">
                        <select class="large" name="gsex" style="width:200px">
                        <option value="">--请选择--</option>
                        @foreach($data3 as $v)
                            <option value="{{$v['id']}}">{{$v['suitsex']}}</option>
                        @endforeach
                        </select>
                        <span>【必填项】</span>
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">商品价格范围</label>
                    <div class="mws-form-item">
                        <select class="large" name="pricerange" style="width:200px">
                            <option value=''>--请选择--</option>
                            @foreach($data2 as $v)
                                <option value="{{$v['id']}}">{{$v['pricerange']}}</option>                             
                            @endforeach
=======
                    <label class="mws-form-label">商品价格范围</label>
                    <div class="mws-form-item">
                        <select class="large" name="pricerange" style="width:200px">
                            <option value='0'>--请选择--</option>
                            <option value='0-200'>--0-200--</option>
                            <option value='200-500'>--200-500--</option>
                            <option value='500-1000'>--500-1000--</option>
                            <option value='1000-1500'>--1000-1500--</option>
                            <option value='1500-2000'>--1500-2000--</option>
                            <option value='2000以上'>--2000以上--</option>
>>>>>>> 31e42f2d3415b82d4888522298db4e7de5f9c8aa
                        </select>
                        <span>【必填项】</span>
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">商品价格</label>
                    <div class="mws-form-item">
                        <input type="text" class="small" name="goodsprice" style="width:200px">
                        <span>【必填项】</span>
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">材质成分</label>
                    <div class="mws-form-item">
                        <select class="large" name="material" style="width:200px">
                            <option value=''>--请选择--</option>
                            <option value='棉'>--棉--</option>
                            <option value='麻'>--麻--</option>
                            <option value='丝绸'>--丝绸--</option>
                            <option value='呢绒'>--呢绒--</option>
                            <option value='皮革'>--皮革--</option>
                            <option value='化纤'>--化纤--</option>
                            <option value='混纺'>--混纺--</option>
                        </select>
                        <span>【必填项】</span>
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">品牌</label>
                    <div class="mws-form-item">
                        <select class="large" name="brand" style="width:200px">
                            <option value=''>--请选择--</option>
<<<<<<< HEAD
                            @foreach($data1 as $v)
                                <option value="{{$v['id']}}">{{$v['brandname']}}</option>                             
                            @endforeach
=======
                            <option value='布根香'>--布根香--</option>
                            <option value='BGV'>--BGV--</option>
                            <option value='简约风情'>--简约风情--</option>
                            <option value='优衣库'>--优衣库--</option>
                            <option value='谜底'>--谜底--</option>
                            <option value='betu'>--betu--</option>
                            <option value='纯粹'>--纯粹--</option>
                            <option value='千百惠'>--千百惠--</option>
                            <option value='速购'>--速购--</option>
                            <option value='佰佧丽'>--佰佧丽--</option>
                            <option value='依路佑妮'>--依路佑妮--</option>
                            <option value='丹比奴'>--丹比奴--</option>
                            <option value='丝雨桐'>--丝雨桐--</option>
                            <option value='觅玛'>--觅玛--</option>
                            <option value='其他'>--其他--</option>
>>>>>>> 31e42f2d3415b82d4888522298db4e7de5f9c8aa
                        </select>
                        <span>【必填项】</span>
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">风格</label>
                    <div class="mws-form-item">
                        <input type="text" class="small" name="style" style="width:200px">
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">适用季节</label>
                    <div class="mws-form-item">
                        <select class="large" name="season" style="width:200px">
                            <option value='0'>--请选择--</option>
                            <option value='1'>--春季--</option>
                            <option value='2'>--夏季--</option>
                            <option value='3'>--秋季--</option>
                            <option value='4'>--冬季--</option>
                        </select>
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">适用场景</label>
                    <div class="mws-form-item">
                        <input type="text" class="small" name="application" style="width:200px">
                    </div>
                </div>
                <div class="mws-form-row">
                    <label class="mws-form-label">商品状态</label>
                    <div class="mws-form-item">
                        <select class="large" name="status" style="width:200px">
                            <option value='1'>--在架--</option>
                            <option value='2'>--促销--</option>
                            <option value='3'>--下架--</option>
                        </select>
                    </div>
                </div>
                <div class="mws-form-row">
<<<<<<< HEAD
=======
                    <label class="mws-form-label">促销价格</label>
                    <div class="mws-form-item">
                        <input type="text" class="small" name="goodsprice2" style="width:200px">
                    </div>
                </div>
                <div class="mws-form-row">
>>>>>>> 31e42f2d3415b82d4888522298db4e7de5f9c8aa
                    <label class="mws-form-label">商品详情</label>
                    <div class="mws-form-item">
                        <!-- 加载编辑器的容器 -->
                        <script id="containers" name="content" type="text/plain">
                        </script>
                        <!-- 配置文件 -->
                        <script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
                        <!-- 编辑器源码文件 -->
                        <script type="text/javascript" src="/ueditor/ueditor.all.js">
                        </script>
                        <!-- 实例化编辑器 -->
                        <script type="text/javascript">
                            var ue = UE.getEditor('containers');
                        </script>
                    </div>
                </div>      
    		</div>
    		<div class="mws-button-row">
    			<input type="submit" class="btn btn-danger" value="添加">
    			<input type="reset" class="btn " value="重置">
    		</div>
    	</form>
    </div>    	
</div>
@endsection
